package com.gitee.somenvm.ninerpgitem

import org.bukkit.Bukkit
import taboolib.common.platform.Plugin
import taboolib.common.platform.function.console
import taboolib.common.platform.function.info
import taboolib.module.chat.colored
import taboolib.module.configuration.Config
import taboolib.module.configuration.Configuration
import taboolib.platform.BukkitPlugin

/**
 * 插件主类
 */
object NineRpgItem : Plugin() {
    /**
     * 插件对象
     */
    val plugin by lazy {
        BukkitPlugin.getInstance()
    }

    /**
     * 配置文件
     */
    @Config
    lateinit var config: Configuration

    /**
     * 启动时运行
     */
    override fun onEnable() {
        val serverVersion = Bukkit.getServer().version
        console().sendMessage("&m----------------------------------------------------".colored())
        console().sendMessage("&3███&1╗   &3██&1╗&3██&1╗&3███&1╗   &3██&1╗&3███████&1╗      &7".colored() + serverVersion)
        console().sendMessage("&3████&1╗  &3██&1║&3██&1║&3████&1╗  &3██&1║&3██&1╔════╝".colored())
        console().sendMessage("&3██&1╔&3██&1╗ &3██&1║&3██&1║&3██&1╔&3██&1╗ &3██&1║&3█████&1╗".colored())
        console().sendMessage("&3██&1║╚&3██&1╗&3██&1║&3██&1║&3██&1║╚&3██&1╗&3██&1║&3██&1╔══╝".colored())
        console().sendMessage("&3██&1║ ╚&3████&1║&3██&1║&3██&1║ ╚&3████&1║&3███████&1╗".colored())
        console().sendMessage("&1╚═╝  ╚═══╝╚═╝╚═╝  ╚═══╝╚══════╝  &bRpg Item  &eVer.&f${this.plugin.description.version}".colored())
        console().sendMessage("NineRpgItem加载完成！")
    }

    /**
     * 插件关闭时运行
     */
    override fun onDisable() {
        info("&cNineRpgItem UnLoad.".colored())
    }
}